const arr1 = [1, 2, 3, 4]
const arr2 = [1, 3, 5, 6, 7]

class Arr {
    // 并
    Union(arr1,arr2) {
        return [...new Set(arr1.concat(arr2))]
    }
    // 交
    intersections(arr1,arr2) {
        return arr1.filter((e) => arr2.includes(e))
    }
    // 差 由所有属于Arr1且不属于Arr2的元素组成.
    subtraction(arr1,arr2) {
        return arr1.filter((e) => !arr2.includes(e))
    }
}
const arr = new Arr()
console.log(arr.Union(arr1, arr2));
console.log(arr.intersections(arr1, arr2));
console.log(arr.subtraction(arr1, arr2));
